params.wave = [450 550 650];
params.positionDegs =[0 0];
thisSubject = params.thisSubject;
positionDegs = params.positionDegs;
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; mp = parula(256); mp(1:4,:) = repmat([0.5 0.5 0.5],[4,1]);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
grid on; hold on; axis xy
% Superimpose the line spread
% Plot the LSF starting from -10 and scaled to -5.
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
title(sprintf('W %d Sub %d',thisW,thisSubject));
xlabel('Position (arc min)'); ylabel('Position (arc min)');
end
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
zCoeffDatabase = 'Artal2012';
params.positionDegs =[1 0; 10 0; 20 0];
positionDegs = params.positionDegs(ii,:);
thisSubject = params.thisSubject;
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; colormap(mp);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
grid on; axis xy; hold on;
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
title(sprintf('W %d Sub %d Pos %f',thisW,thisSubject,positionDegs(1)));
xlabel('Position (arc min)');
if ii == 1, ylabel('Position (arc min)'); end
zCoeffDatabase = 'Artal2012';
params.thisSubject = [5 15 25];
params.positionDegs =[5 0];
positionDegs = params.positionDegs;
thisSubject = params.thisSubject(ii);
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
idx = find(wave == thisW);
imagesc(support.x,support.y,psf(:,:,idx)/max2(psf(:,:,idx)));
axis image; colormap(mp);
tMarks = (-15:5:15); mn = -10; mx = 10;
set(gca,'xtick',tMarks,'xlim',[mn mx],'ylim',[mn mx]);
grid on; axis xy; hold on;
thisLSF = lsf(:,idx)/max(lsf(:,idx));
plot(support.y,5*thisLSF-10,'b-','Linewidth',4);
xlabel('Position (arc min)');
if ii == 1, ylabel('Position (arc min)'); end
title(sprintf('W %d Sub %d Pos %f',thisW,thisSubject,positionDegs(1)));
end
Subject 51 from right eye requires central refraction correction
Subject 11 from right eye requires central refraction correction
scene = sceneCreate('slanted edge', 512, Inf);
scene = sceneSet(scene,'fov',2);
cmP.positionDegs = [1,0];
cmP.sizeDegs = [0.5 0.3];
cm = cMosaic(cmP);
min cone aperture diameter = 2.566750 microns
cm.integrationTime = 0.05;
zCoeffDatabase = 'Artal2012';
subjectRank = 15; % [10, 40];
for ss = 1:numel(subjectRank)
uData = cell(numel(ecc),1);
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', subjectRank(ss), ...
'eye side', eyeside,'center psf',centerpsf);
% These are the pupilMM and zCoeffs from the top of the file.
% oi = oiCreate('wvf human', pupilMM, zCoeffs, wave);
oi = oiCompute(oi,scene);
[uData{n}, hdl] = cm.plot('excitations horizontal line',allE,...
'plot title',sprintf('Optics ecc %d Rank %d',ii,subjectRank), ...
cm.plot('excitations',allE);
end
Subject 11 from right eye requires central refraction correction
min cone aperture diameter = 2.576892 microns
cc = 1; % Which color channel
sym = {'ko-','kx:','ks-'};
plot(posE{cc}, (tmp)/mx,sym{ii},'LineWidth',2);
legend({num2str(ecc')},'Location','northwest');
title(sprintf('Subject %d Conetype %d',subjectRank(ss),cc));
xlabel('Position (deg)'); ylabel('Relative excitations');
set(gcf,'Position',[4.0000e-04 0.5486 0.7992 0.3687]);
params.row = 1024; params.col = 1024;
scene = sceneCreate('harmonic',params);
scene = sceneSet(scene,'fov',10);
zCoeffDatabase = 'Artal2012';
subjectRank = 1; % 1:8; % [2, 5, 10, 20];
for thisSubject = subjectRank
lsf = zeros(201,numel(wave),numel(pos));
positionDegs = [pos(ii) 0]; % v
[oi, psf, support, zCoeffs, subjID] = ...
oiPosition(zCoeffDatabase, 'position',positionDegs, ...
'pupil diameter', pupilDiamMM, 'subject rank', thisSubject, ...
'eye side', eyeside,'center psf',centerpsf);
lsf(:,:,ii) = psf2lsf(psf);
% Find the luminance weighted sum (luminance)
lumLSF = zeros(201,numel(pos));
vLambda = ieReadSpectra('Vlambda',wave);
lumLSF(:,ii) = lsf(:,:,ii)*vLambda(:);
lumLSF = lumLSF/max(lumLSF(:));
plot(support.y,lumLSF(:,ii),'k-','Linewidth',2);
xlabel('Arc min'); ylabel('Relative luminance')
set(gca,'ylim',[-0.1 1]); set(gca,'xlim',[-5 5]);
set(gca,'xtick',(-5:2.5:5));
legend(sprintf('Subject %d',thisSubject));
print(sprintf('LSF_%s_%d',zCoeffDatabase,thisSubject),'-dpng');
end
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
Subject 49 from right eye requires central refraction correction
wavesamples = [400, 450, 500, 550, 600, 650];
leg = cell(numel(wavesamples),1);
for ii=1:numel(wavesamples)
leg{ii} = [num2str(wavesamples(ii)),' nm'];
for ii=1:numel(wavesamples)
idx = find(wave == wavesamples(ii));
plot(support.y,lsf(:,idx)/max(lsf(:,idx)),'Linewidth',2);
set(gca,'xlim',[-8 8],'ylim',[0 1]);
xlabel('Arc min'); ylabel('Relative intensity');
lsfs = zeros(201,numel(pos));
tmp = squeeze(lsf(:,idx,ii));
thisLSF = lsf(:,idx,ii)/sum(lsf(:,idx,ii));
surf(pos,support.y,lumLSF);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Artal data, Subj rank: %d',subjectRank));
% Compare at a single wavelength
idx = find(wave == thisWave);
lsfs = zeros(201,numel(pos));
tmp = squeeze(lsf(:,idx,ii));
thisLSF = lsf(:,idx,ii)/sum(lsf(:,idx,ii));
plot(support.x,lsfs(:,ii));
surf(pos,support.y,lsfs);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Wave %d',thisWave));
%% Sampled at 0.5 min which is the cone density in the fovea
lsfsInterp = interp2(pos(:),support.y(:),lsfs,possamples,arcmin);
surf(possamples,arcmin,lsfsInterp);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
title(sprintf('Wave %d',thisWave));
surf(possamples',arcmin(:),sInterp);
xlabel('Eccentricity (deg)'); ylabel('Arc min');
xlabel('arc min'); ylabel('relative intensity');
imagesc(support.x, support.y, squeeze(psf(:,:,idx)));
axis 'square'; colormap(gray); xlabel('arc min'); ylabel('arc min');
%% Try putting the zCoeffs for a subject into an oi